<template>
  <div class="delivery-list">
    <div class="dashboard-content">
      <canvas width="800" height="500" ref="income"></canvas>
    </div>
  </div>
</template>

<script>
import * as echarts from "echarts";
export default {
  name: "customer",
  data() {
    return {};
  },
  mounted() {
    this.init();
  },
  methods: {
    init() {
      var chartDom = this.$refs.income;
      var myChart = echarts.init(chartDom);
      var option;

      option = {
        title: {
          text: "去年与今年收入对比",
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "shadow",
          },
        },
        legend: {},
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        xAxis: {
          type: "category",
          boundaryGap: [0, 0.01],
        },
        yAxis: {
          type: "value",
          data: ["Brazil", "Indonesia", "USA", "India", "China", "World"],
        },
        series: [
          {
            name: "去年收入(万元)",
            type: "bar",
            data: [18203, 23489, 29034, 104970, 131744, 630230],
          },
          {
            name: "今年收入(万元)",
            type: "bar",
            data: [19325, 23438, 31000, 121594, 134141, 681807],
          },
        ],
      };

      option && myChart.setOption(option);
    },
  },
};
</script>

<style lang="less" scoped>
.dashboard-content {
  padding-top: 50px;
}
</style>
